﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// wx_userinfo数据模型对象
    /// </summary>
    [Serializable]
    public partial class wx_userinfoMod : IEntity, IEntityTypeBuilder<wx_userinfoMod>
    {
        /// <summary>
        /// 初始化wx_userinfo数据模型对象
        /// </summary>
        public wx_userinfoMod()
        {
            
        }
        /// <summary>
        /// 初始化wx_userinfo数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="wxkey">wxkey</param>
        /// <param name="openID">OpenID</param>
        /// <param name="phone">phone</param>
        /// <param name="username">username</param>
        /// <param name="mTime">MTime</param>
        /// <param name="cTime">CTime</param>
        /// <param name="auth">auth</param>
        /// <param name="isManager">isManager</param>
        public wx_userinfoMod(string wxkey,string openID,string phone,string username,DateTime mTime,DateTime cTime,int auth,int isManager)
        {
            //给wxkey字段赋值
            this.Wxkey = wxkey;
            //给OpenID字段赋值
            this.OpenID = openID;
            //给phone字段赋值
            this.Phone = phone;
            //给username字段赋值
            this.Username = username;
            //给MTime字段赋值
            this.MTime = mTime;
            //给CTime字段赋值
            this.CTime = cTime;
            //给auth字段赋值
            this.Auth = auth;
            //给isManager字段赋值
            this.IsManager = isManager;
        }
        /// <summary>
        /// 初始化wx_userinfo数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="wxkey">wxkey</param>
        /// <param name="openID">OpenID</param>
        /// <param name="sessionKey">SessionKey</param>
        /// <param name="phone">phone</param>
        /// <param name="username">username</param>
        /// <param name="mTime">MTime</param>
        /// <param name="cTime">CTime</param>
        /// <param name="city">city</param>
        /// <param name="auth">auth</param>
        /// <param name="nickurl">nickurl</param>
        /// <param name="area">area</param>
        /// <param name="deviceNo">DeviceNo</param>
        /// <param name="isManager">isManager</param>
        /// <param name="unionid">unionid</param>
        /// <param name="appID">AppID</param>
        /// <param name="nickname">nickname</param>
        /// <param name="headimgurl">headimgurl</param>
        /// <param name="acceptMsg">acceptMsg</param>
        public wx_userinfoMod(string wxkey,string openID,string sessionKey,string phone,string username,DateTime mTime,DateTime cTime,string city,int auth,string nickurl,string area,string deviceNo,int isManager,string unionid,string appID,string nickname,string headimgurl,string acceptMsg)
        {
            //给wxkey字段赋值
            this.Wxkey = wxkey;
            //给OpenID字段赋值
            this.OpenID = openID;
            //给SessionKey字段赋值
            this.SessionKey = sessionKey;
            //给phone字段赋值
            this.Phone = phone;
            //给username字段赋值
            this.Username = username;
            //给MTime字段赋值
            this.MTime = mTime;
            //给CTime字段赋值
            this.CTime = cTime;
            //给city字段赋值
            this.City = city;
            //给auth字段赋值
            this.Auth = auth;
            //给nickurl字段赋值
            this.Nickurl = nickurl;
            //给area字段赋值
            this.Area = area;
            //给DeviceNo字段赋值
            this.DeviceNo = deviceNo;
            //给isManager字段赋值
            this.IsManager = isManager;
            //给unionid字段赋值
            this.Unionid = unionid;
            //给AppID字段赋值
            this.AppID = appID;
            //给nickname字段赋值
            this.Nickname = nickname;
            //给headimgurl字段赋值
            this.Headimgurl = headimgurl;
            //给acceptMsg字段赋值
            this.AcceptMsg = acceptMsg;
        }
        
		//属性存储数据的变量
        private string _wxkey;
        private string _openID;
        private string _sessionKey;
        private string _phone;
        private string _username;
        private DateTime _mTime;
        private DateTime _cTime;
        private string _city;
        private int _auth;
        private string _nickurl;
        private string _area;
        private string _deviceNo;
        private int _isManager;
        private string _unionid;
        private string _appID;
        private string _nickname;
        private string _headimgurl;
        private string _acceptMsg;
        
        /// <summary>
        /// wxkey
        /// </summary>
        public string Wxkey
        {
            get { return this._wxkey; }
            set { this._wxkey = value; }
        }
        /// <summary>
        /// OpenID
        /// </summary>
        public string OpenID
        {
            get { return this._openID; }
            set { this._openID = value; }
        }
        /// <summary>
        /// SessionKey
        /// </summary>
        public string SessionKey
        {
            get { return this._sessionKey; }
            set { this._sessionKey = value; }
        }
        /// <summary>
        /// phone
        /// </summary>
        public string Phone
        {
            get { return this._phone; }
            set { this._phone = value; }
        }
        /// <summary>
        /// username
        /// </summary>
        public string Username
        {
            get { return this._username; }
            set { this._username = value; }
        }
        /// <summary>
        /// MTime
        /// </summary>
        public DateTime MTime
        {
            get { return this._mTime; }
            set { this._mTime = value; }
        }
        /// <summary>
        /// CTime
        /// </summary>
        public DateTime CTime
        {
            get { return this._cTime; }
            set { this._cTime = value; }
        }
        /// <summary>
        /// city
        /// </summary>
        public string City
        {
            get { return this._city; }
            set { this._city = value; }
        }
        /// <summary>
        /// auth
        /// </summary>
        public int Auth
        {
            get { return this._auth; }
            set { this._auth = value; }
        }
        /// <summary>
        /// nickurl
        /// </summary>
        public string Nickurl
        {
            get { return this._nickurl; }
            set { this._nickurl = value; }
        }
        /// <summary>
        /// area
        /// </summary>
        public string Area
        {
            get { return this._area; }
            set { this._area = value; }
        }
        /// <summary>
        /// DeviceNo
        /// </summary>
        public string DeviceNo
        {
            get { return this._deviceNo; }
            set { this._deviceNo = value; }
        }
        /// <summary>
        /// isManager
        /// </summary>
        public int IsManager
        {
            get { return this._isManager; }
            set { this._isManager = value; }
        }
        /// <summary>
        /// unionid
        /// </summary>
        public string Unionid
        {
            get { return this._unionid; }
            set { this._unionid = value; }
        }
        /// <summary>
        /// AppID
        /// </summary>
        public string AppID
        {
            get { return this._appID; }
            set { this._appID = value; }
        }
        /// <summary>
        /// nickname
        /// </summary>
        public string Nickname
        {
            get { return this._nickname; }
            set { this._nickname = value; }
        }
        /// <summary>
        /// headimgurl
        /// </summary>
        public string Headimgurl
        {
            get { return this._headimgurl; }
            set { this._headimgurl = value; }
        }
        /// <summary>
        /// acceptMsg
        /// </summary>
        public string AcceptMsg
        {
            get { return this._acceptMsg; }
            set { this._acceptMsg = value; }
        }
        
        /// <summary>
        /// 对比两个wx_userinfo数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的wx_userinfo数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成wx_userinfo数据模型对象
            wx_userinfoMod wx_userinfoMod = obj as wx_userinfoMod;
            //判断是否转换成功
            if (wx_userinfoMod == null) return false;
            //进行匹配属性的值
            return
                //判断wxkey是否一致
                this.Wxkey == wx_userinfoMod.Wxkey &&
                //判断OpenID是否一致
                this.OpenID == wx_userinfoMod.OpenID &&
                //判断SessionKey是否一致
                this.SessionKey == wx_userinfoMod.SessionKey &&
                //判断phone是否一致
                this.Phone == wx_userinfoMod.Phone &&
                //判断username是否一致
                this.Username == wx_userinfoMod.Username &&
                //判断MTime是否一致
                this.MTime == wx_userinfoMod.MTime &&
                //判断CTime是否一致
                this.CTime == wx_userinfoMod.CTime &&
                //判断city是否一致
                this.City == wx_userinfoMod.City &&
                //判断auth是否一致
                this.Auth == wx_userinfoMod.Auth &&
                //判断nickurl是否一致
                this.Nickurl == wx_userinfoMod.Nickurl &&
                //判断area是否一致
                this.Area == wx_userinfoMod.Area &&
                //判断DeviceNo是否一致
                this.DeviceNo == wx_userinfoMod.DeviceNo &&
                //判断isManager是否一致
                this.IsManager == wx_userinfoMod.IsManager &&
                //判断unionid是否一致
                this.Unionid == wx_userinfoMod.Unionid &&
                //判断AppID是否一致
                this.AppID == wx_userinfoMod.AppID &&
                //判断nickname是否一致
                this.Nickname == wx_userinfoMod.Nickname &&
                //判断headimgurl是否一致
                this.Headimgurl == wx_userinfoMod.Headimgurl &&
                //判断acceptMsg是否一致
                this.AcceptMsg == wx_userinfoMod.AcceptMsg;
        }
        /// <summary>
        /// 将当前wx_userinfo数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将wx_userinfo数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将wxkey进行按位异或运算处理
                (this.Wxkey == null ? 2147483647 : this.Wxkey.GetHashCode()) ^
                //将OpenID进行按位异或运算处理
                (this.OpenID == null ? 2147483647 : this.OpenID.GetHashCode()) ^
                //将SessionKey进行按位异或运算处理
                (this.SessionKey == null ? 2147483647 : this.SessionKey.GetHashCode()) ^
                //将phone进行按位异或运算处理
                (this.Phone == null ? 2147483647 : this.Phone.GetHashCode()) ^
                //将username进行按位异或运算处理
                (this.Username == null ? 2147483647 : this.Username.GetHashCode()) ^
                //将MTime进行按位异或运算处理
                this.MTime.GetHashCode() ^
                //将CTime进行按位异或运算处理
                this.CTime.GetHashCode() ^
                //将city进行按位异或运算处理
                (this.City == null ? 2147483647 : this.City.GetHashCode()) ^
                //将auth进行按位异或运算处理
                this.Auth.GetHashCode() ^
                //将nickurl进行按位异或运算处理
                (this.Nickurl == null ? 2147483647 : this.Nickurl.GetHashCode()) ^
                //将area进行按位异或运算处理
                (this.Area == null ? 2147483647 : this.Area.GetHashCode()) ^
                //将DeviceNo进行按位异或运算处理
                (this.DeviceNo == null ? 2147483647 : this.DeviceNo.GetHashCode()) ^
                //将isManager进行按位异或运算处理
                this.IsManager.GetHashCode() ^
                //将unionid进行按位异或运算处理
                (this.Unionid == null ? 2147483647 : this.Unionid.GetHashCode()) ^
                //将AppID进行按位异或运算处理
                (this.AppID == null ? 2147483647 : this.AppID.GetHashCode()) ^
                //将nickname进行按位异或运算处理
                (this.Nickname == null ? 2147483647 : this.Nickname.GetHashCode()) ^
                //将headimgurl进行按位异或运算处理
                (this.Headimgurl == null ? 2147483647 : this.Headimgurl.GetHashCode()) ^
                //将acceptMsg进行按位异或运算处理
                (this.AcceptMsg == null ? 2147483647 : this.AcceptMsg.GetHashCode());
        }
        /// <summary>
        /// 将当前wx_userinfo数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前wx_userinfo数据模型对象转换成字符串副本
            return
                "[" +
                //将wxkey转换成字符串
                this.Wxkey + "," +
                //将OpenID转换成字符串
                this.OpenID + "," +
                //将phone转换成字符串
                this.Phone + "," +
                //将username转换成字符串
                this.Username + "," +
                //将MTime转换成字符串
                this.MTime + "," +
                //将CTime转换成字符串
                this.CTime + "," +
                //将auth转换成字符串
                this.Auth + "," +
                //将isManager转换成字符串
                this.IsManager +
                "]";
        }

        public void Configure(EntityTypeBuilder<wx_userinfoMod> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder.ToTable("wx_userinfo");
            entityBuilder.HasComment("设备管理");
            entityBuilder.HasKey(e => e.OpenID);
        }
    }
}
